package xionglizhen.service;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import xionglizhen.entity.User;
import xionglizhen.mapper.UserMapper;
import org.springframework.stereotype.Service;

//User服务类
//一般被控制器调用
//控制器调用service，再由service调用数据库的操做
@Service
public class UserService extends ServiceImpl<UserMapper, User> {
    public User findUserAccount(User user) {
        LambdaQueryWrapper<User> lambdaQueryWrapper = new LambdaQueryWrapper<>();
        lambdaQueryWrapper.eq(User::getUserAccount, user.getUserAccount());
        return this.getOne(lambdaQueryWrapper);
    }
}
